<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>迟到列表数据</title>
		
		<!--导入vue这个包-->
		<script type="text/javascript" src="js/vue.js"></script>
		
	</head>
	<body>
		
		<!-- <div class="abc">{{teacher.phone}}</div> -->
		
		<table>
			<tr>
				<!-- <td class="abc">{{student}}</td> -->
				<!-- <td class="abc">{{age}}</td> -->
			</tr>
		</table>
		
		<p>{{fangwang[2]}}</p>
		
	</body>
	
	<script type="text/javascript">
	
		//1 搞出这个类的对象
		//var vue = new Vue();
		
		//2 对象中有属性、方法  这些属性和方法必须放在大括号中 而且大括号要在()里面
		
		var vue=new Vue({
			
			el:'p',
			data:{
				age:18,
				student:'周海燕',
				fangwang:['紫衫龙王黛绮丝','白眉鹰王殷天正','金毛狮王谢逊','青翼蝠王韦一笑'],
				teacher:{
					teacherName:'黄老师',
					phone:13267128038,
				},
			},
			methods:{
				add:function(x,y){
					var sum = x+y;
					return sum;
				},
				mo:function(x,y){
					var mo = x%y;
					return mo;
				}
				
				
			}
			
		});
		
		
		var jieguo =vue.add(10,20);
		console.log(jieguo);
		
		
		/* //在纯JS中定义1个方法
		function add(x,y){
			var sum = x+y;
			return sum;
		}
		
		var jieguo=add(1,2);
		console.log(jieguo); */
		
		//3 讲2个特殊属性
	
			
		/* var yttlj={
			
			'jiaozhu':'张无忌',
			'四大法王':['谢逊','韦一笑','纳爱斯'],
		};
		
		console.log(yttlj.jiaozhu); */
		
	
	</script>
</html>
